//
// Created by xin on 2019/10/3.
//
#include <stdio.h>
#include <string.h>

typedef struct student {
    char ID[10];
    char name[20];
    char age[10];
    char score[10];
} stu;

void genTpl(char *name) {
    stu students[1] = {
            {"ID", "name", "age", "score"},
    };

    stu *p;
    FILE *f;
    f = fopen(name, "wa");

    for (p = students; p < p + 4; ++p) {
        fwrite(p->ID, 1, strlen(p->ID), f);
        fwrite(p->name, 1, strlen(p->name), f);
        fwrite(p->age, 1, strlen(p->age), f);
        fwrite(p->score, 1, strlen(p->score), f);
        fwrite("\r\n", 1, 3, f);
    }

    fclose(f);
}